import math
guests = list(map(int, input().split()))

cnt = {}
ans = 0
maxCnt = 0
for i in guests:
    if i in cnt:
        cnt[i]+=1
    else:
        cnt[i] = 1
    
    if cnt[i]>maxCnt:
        ans = i
        maxCnt = cnt[i]

if maxCnt < math.ceil(len(guests)/2):
    ans = 0


    
